package com.hziee.graduate.ticket.controller;



import com.hziee.graduate.ticket.dto.R;
import com.hziee.graduate.ticket.entity.RoomRecord;
import com.hziee.graduate.ticket.service.RoomRecordService;
import com.hziee.graduate.ticket.vo.RoomRecordVO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@RestController
@RequestMapping("roomRecord")
public class RoomRecordController {

    @Resource
    private RoomRecordService roomRecordService;

    @PostMapping("/addARoomRecord")
    public R<RoomRecordVO> addARoomRecord(@RequestBody Map<String,Object> map) {
        return roomRecordService.addARoomRecord(map);
    }

    @GetMapping("/getAllRoomRecordOrderByTime/{cinemaId}")
    public R<List<RoomRecordVO>> getAllRoomRecord(@PathVariable Long cinemaId) {
        return roomRecordService.getAllRoomRecordOrderByTime(cinemaId);
    }

}

